﻿using UnityEngine;
using System.Collections;

public class ShipAttributes : MonoBehaviour {
	public GameObject Explosion;
	public Vector3 explosionOffset;
	ObjectPool pool;
	void OnTriggerEnter2D(Collider2D collider) {
		if(collider != null) {
			if(collider.GetComponent<Blaster>() != null) {
				collider.GetComponent<Blaster>().pushToPool();
				Instantiate(Explosion, transform.position + explosionOffset, Quaternion.identity);
				pool.pushToPool (gameObject);
			}
		}
	}

	public void setObjectPool(ObjectPool pool) {
		this.pool = pool;
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}
